Because why not.
Standard hasing table sizing.
Capacity = items/itemLimit
@ 75% capacity or more, double limit @ less 25% capacity, half the limit
Do it without using an 'if' statement.
Boolean to Number typcasting -- +(logicalExpression) -- is frowned upon.